[SPARK-37452][SQL][3.1] Char and Varchar break backward compatibility between v3.1 and v2#34736
Closed
yaooqinn wants to merge 2 commits intoapache:branch-3.1from
Closed
[SPARK-37452][SQL][3.1] Char and Varchar break backward compatibility between v3.1 and v2#34736yaooqinn wants to merge 2 commits intoapache:branch-3.1from
yaooqinn wants to merge 2 commits intoapache:branch-3.1from
Conversation
…patibility between v3.1 and v2
…patibility between v3.1 and v2
cloud-fan
approved these changes
Nov 29, 2021
|
Kubernetes integration test starting |
|
Kubernetes integration test status failure |
|
Test build #145708 has finished for PR 34736 at commit
|
dongjoon-hyun
pushed a commit
that referenced
this pull request
Nov 30, 2021
… between v3.1 and v2 This backports #34697 to 3.1 ### What changes were proposed in this pull request? We will store table schema in table properties for the read-side to restore. In Spark 3.1, we add char/varchar support natively. In some commands like `create table`, `alter table` with these types, the `char(x)` or `varchar(x)` will be stored directly to those properties. If a user uses Spark 2 to read such a table it will fail to parse the schema. FYI, https://github.com/apache/spark/blob/branch-2.4/sql/catalyst/src/main/scala/org/apache/spark/sql/types/DataType.scala#L136 A table can be a newly created one by Spark 3.1 and later or an existing one modified by Spark 3.1 and on. ### Why are the changes needed? backward compatibility ### Does this PR introduce _any_ user-facing change? That's not necessarily user-facing as a bugfix and only related to internal table properties. ### How was this patch tested? manully Closes #34736 from yaooqinn/PR_TOOL_PICK_PR_34697_BRANCH-3.1. Authored-by: Kent Yao <yao@apache.org> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
fishcus
pushed a commit
to fishcus/spark
that referenced
this pull request
Jan 12, 2022
… between v3.1 and v2 This backports apache#34697 to 3.1 ### What changes were proposed in this pull request? We will store table schema in table properties for the read-side to restore. In Spark 3.1, we add char/varchar support natively. In some commands like `create table`, `alter table` with these types, the `char(x)` or `varchar(x)` will be stored directly to those properties. If a user uses Spark 2 to read such a table it will fail to parse the schema. FYI, https://github.com/apache/spark/blob/branch-2.4/sql/catalyst/src/main/scala/org/apache/spark/sql/types/DataType.scala#L136 A table can be a newly created one by Spark 3.1 and later or an existing one modified by Spark 3.1 and on. ### Why are the changes needed? backward compatibility ### Does this PR introduce _any_ user-facing change? That's not necessarily user-facing as a bugfix and only related to internal table properties. ### How was this patch tested? manully Closes apache#34736 from yaooqinn/PR_TOOL_PICK_PR_34697_BRANCH-3.1. Authored-by: Kent Yao <yao@apache.org> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This backports #34697 to 3.1
What changes were proposed in this pull request?
We will store table schema in table properties for the read-side to restore. In Spark 3.1, we add char/varchar support natively. In some commands like
create table,alter tablewith these types, thechar(x)orvarchar(x)will be stored directly to those properties. If a user uses Spark 2 to read such a table it will fail to parse the schema.FYI, https://github.com/apache/spark/blob/branch-2.4/sql/catalyst/src/main/scala/org/apache/spark/sql/types/DataType.scala#L136
A table can be a newly created one by Spark 3.1 and later or an existing one modified by Spark 3.1 and on.
Why are the changes needed?
backward compatibility
Does this PR introduce any user-facing change?
That's not necessarily user-facing as a bugfix and only related to internal table properties.
How was this patch tested?
manully